package be.rivendale.renderer.mk2.data;

import java.util.concurrent.LinkedBlockingQueue;

public class Queue<T> {
    private LinkedBlockingQueue<T> queue = new LinkedBlockingQueue<T>();

    public void put(T item) {
        try {
            queue.put(item);
        } catch (InterruptedException exception) {
            throw new RuntimeException("Unable to put item on queue", exception);
        }
    }

    public T take() {
        try {
            return queue.take();
        } catch (InterruptedException exception) {
            throw new RuntimeException("Unable to take item from queue", exception);
        }
    }
}
